package com.userfactssample.client.client.framework;

import com.smartgwt.mobile.client.types.Alignment;

public enum UMAlignment {
    /**
     * Center within container.
     */
    CENTER("center", Alignment.CENTER),
    /**
     * Stick to left side of container.
     */
    LEFT("left", Alignment.LEFT),
    /**
     * Stick to right side of container.
     */
    RIGHT("right", Alignment.RIGHT);

    private String code;
    private Alignment value;

    UMAlignment(String code, Alignment value) {
    	this.code = code;
        this.value = value;
    }
    
    public String getCode() {
    	return this.code;
    }

    public Alignment getAlign() {
        return this.value;
    }
    
    public static UMAlignment getAlignment(String align) {
    	for(UMAlignment alignment : UMAlignment.values()) {
    		if (alignment.getCode().equals(align))
    			return alignment;
    	}
    	
    	return null;
    }
}